#学生类
class Student:
    def __init__(self,id,name,age,sex,tall,weight,grade,address,tellphone):
        self.id=id
        self.name=name
        self.age=age
        self.sex=sex
        self.tall=tall
        self.weight=weight
        self.grade=grade
        self.address=address
        self.tellphone=tellphone
    def study(self,time):
        print('{}学了{}分钟'.format(self.name,time))
    def playgame(self,game_name):
        print("{}在玩{}游戏".format(self.name,game_name))
    def biancheng(self,hangshu):
        print("{}编程了{}行".format(self.name,hangshu))
    def sum_nums(*num):
        return sum(num)
    print(sum_nums(1, 2, 3, 4, 5))
p1=Student('111',"张三",16,"男",180,65,95,"河南","125462124")
p1.study(12)
p1.playgame("王者")
p1.biancheng(3)
#车类
class Car:
    def __init__(self,model,tire_num,color,weight,capacity):
        self.model=model
        self.tire_num=tire_num
        self.color=color
        self.weight=weight
        self.capacity=capacity
    def run(self,gn1):
        print("{}可以{}".format(self.model,gn1))
p1=Car("法拉利",4,"黑色","1000kg","100升")
p2=Car("宝马",4,"黑色","1000kg","100升")
p3=Car("铃木",4,"黑色","1000kg","100升")
p4=Car("五菱",4,"黑色","1000kg","100升")
p5=Car("拖拉机",4,"黑色","1000kg","100升")
p1.run("越野")
p2.run("越野")
p3.run("越野")
p4.run("赛车")
p5.run("赛车")
#笔记本
class Note_pc:
    def __init__(self,model,runtime,color,weight,cpu_model,inner_capcity,hard_disk_capacity):
        self.model=model
        self.runtime=runtime
        self.color=color
        self.weight=weight
        self.cpu_model=cpu_model
        self.inner_capacity=inner_capcity
        self.hard_disk_capacity=hard_disk_capacity
    def play_game(self,game_name):
        print("{}可以玩{}游戏".format(self.model,game_name))
    def work(self):
        print(f"{self.model}可以办公")
p1=Note_pc('联想','1','黑色','1','1','1','1')
p1.play_game("王者")
p1.work()
class Monkey:
    def __init__(self,category,sex,color,weight):
        self.category=category
        self.sex=sex
        self.color=color
        self.weight=weight
    def make_fire(self,cailiao):
        print("{}可以用{}造火".format(self.category,cailiao))
    def study(self,*args):
        for arg in args:
            print("{}可以学习{}".format(self.category,arg))
p1=Monkey("峨眉猴","母","灰","25kg")
p1.make_fire("石头")
p1.study("下棋","跳舞")
#电话业务
class Person:
    def __init__(self,name,sex,age,huafei,phone_brand,battery_capacity,screen_size,max_stand_time,points):
        self.name=name
        self.sex=sex
        self.age=age
        self.huafei=huafei
        self.phone_brand=phone_brand
        self.battery_capacity=battery_capacity
        self.screen_size=screen_size
        self.max_stand_time=max_stand_time
        self.points=points
    def send_message(self,text):
        print("发送信息：{}".format(text))
    def telephone(self,phone_number,time):
        if phone_number == " ":
            print("电话号码为空")
            return
        elif self.huafei < 1:
            print("话费余额不足")
        else:
            print("开始拨打电话")
            if time > 0 and time < 10:
                self.huafei -= time
                koufei=time
                self.points += time*15
            elif time >10 and time <20:
                self.huafei -= time*0.8
                koufei=time*0.8
                self.points += time*39
            else:
                self.huafei -= time * 0.6
                koufei=time*0.6
                self.points += time * 48
            print("电话拨打结束，话费剩余{}，积分累积共{}".format(self.huafei, self.points))
            return koufei
p1=Person("张三","男",23,15,"小米",23,300,"10h",0)
p1.send_message("我想打电话")
p1.telephone("12548889",11)







